#ifndef _DSWONVIF_SESSION_H
#define _DSWONVIF_SESSION_H

#include "base.h"
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavformat/avio.h>

class CDswonvif_session
{
public:
	CDswonvif_session(LPST_ENV_T pEnv, char* pURL);
	virtual ~CDswonvif_session();
private:
	static void* cbRecvStreamThreadFunc(void* pParam){((CDswonvif_session*)pParam)->RecvStreamThreadFunc();return NULL;};
	void RecvStreamThreadFunc();
	static int decode_interrupt_cb(void *ctx){return ((CDswonvif_session*)ctx)->decode_interrupt();};
	int decode_interrupt(){return m_bStopRecvStream;};
	void PutFrameToMem(AVPacket* pFrame);
private:
	LPST_ENV_T m_pEnv;
	bool m_bStopRecvStream;
	pthread_t m_nRecvStreamThreadID;
	char m_sURL[256];
	ST_VIDEO_MEM_T m_video_mem;;
};

#endif

